import router from '../router/index'

import axios from './axios';
const domain='https://hks-sys.dindong.cn/api/';
axios.defaults.baseURL = domain;
axios.interceptors.request.use(function(res) {
  let user_token = ''
  if(window.localStorage.hasOwnProperty('user_token')){
    user_token = window.localStorage.getItem('user_token')
  }
  res.headers.common['User-token'] = user_token
  return res
})
axios.interceptors.response.use(function (response) {
  // 重定向到登录页面
  if (response.data.data == 'no_login'){
    window.localStorage.removeItem('user_name');
    router.replace({ path: '/login'})
  }else{
    return response;
  }
})
//获取验证码
export const getCode = (params) => axios.post('auth/sendVerificationCode', params);
//获取管理员用户信息
export const getAdminUserInfo = (params) => axios.get('admin/auth/getAdminUserInfo', {'params':{...params}});
//登陆
export const companyPublicizeLogin = (params) => axios.post('companyPublicizeLogin',params);
//管理员登录
export const adminSignIn = (params) => axios.post('admin/auth/sign-in',params);
//用户后台登录
export const userAdminLogin = (params) => axios.post('admin/auth/userAdminLogin',params);
//获取后台导航栏栏目
export const getBackstageSectionList = (params) => axios.get('admin/auth/getBackstageSectionList',params);

//获取用户信息
export const getUserInfo = (params) => axios.get('ucenter/getUserInfo', {'params':{...params}});
//用户退出
export const loginOut = () => axios.get('admin/auth/signOut');
//修改密码
export const changePassword = (params) => axios.post('admin/auth/change-pwd', params);

//数据管理
//获取总数量统计
export const getAllData = (params) => axios.get('admin/data/getAllCount', {'params':{...params}});
//获取用户增长统计
export const getUserWeekCount = (params) => axios.get('admin/data/getUserWeekCount', {'params':{...params}});

//用户管理
//获取用户类型筛选列表
export const getUserAuthTypeFilterList = (params) => axios.get('admin/user/getUserAuthTypeFilterList', {'params':{...params}});
//获取用户列表
export const getUserList = (params) => axios.get('admin/user/getUserList', {'params':{...params}});
//用户详情
export const getUserDetail = (params) => axios.get('admin/user/getUserDetail', {'params':{...params}});
//删除用户
export const delUser = (params) => axios.post('admin/sys/delUser', params);
//发布用户协议
export const setUserAgreement = (params) => axios.post('admin/user/setUserAgreement', params);
//改变协议状态
export const changeAgreementStatus = (params) => axios.post('admin/user/changeAgreementStatus', params);
//获取用户协议
export const getUserAgreement = (params) => axios.get('admin/user/getUserAgreement', {'params':{...params}});
//获取认证规则和权益
export const getAuthenticateRule = (params) => axios.get('admin/user/getAuthenticateRule', {'params':{...params}});
//发布认证规则及权益
export const setAuthenticateRule = (params) => axios.post('admin/user/setAuthenticateRule', params);

//获取服务条款
export const getStatement = (params) => axios.get('admin/sys/getStatement', {'params':{...params}});
//设置服务条款的状态
export const setStatementStatus = (params) => axios.post('admin/sys/setStatementStatus', params);
//设置发布需求的服务条款
export const setStatement = (params) => axios.post('admin/sys/setStatement', params);

//获取组列表
export const getGroupList = (params) => axios.get('admin/user/getGroupList', {'params':{...params}});
//获取组详情
export const getGroupDetail = (params) => axios.get('admin/user/getGroupDetail', {'params':{...params}});
//设置组
export const setGroup = (params) => axios.post('/admin/user/setGroup', params);
//删除组
export const delGroup = (params) => axios.post('/admin/user/delGroup', params);
//获取组员列表
export const getGroupMemberList = (params) => axios.get('admin/user/getGroupMemberList', {'params':{...params}});
//添加组员
export const setGroupMember = (params) => axios.post('/admin/user/setGroupMember', params);
//获取组员详情
export const getGroupMemberDetail = (params) => axios.get('admin/user/getGroupMemberDetail', {'params':{...params}});
//删除组员
export const delGroupMember = (params) => axios.post('/admin/user/delGroupMember', params);
//获取未加入当前组的用户
export const getNotJoinGroupUserList = (params) => axios.get('admin/user/getNotJoinGroupUserList', {'params':{...params}});



//vip用户列表
export const getVipUserList = (params) => axios.get('admin/user/getVipUserList', {'params':{...params}});

//删除单位员工或管理员
export const delUnitEmployee = (params) => axios.post('admin/unit/delUnitEmployee', params);

  //专家库
  //获取专家库列表
  export const getExpertsList = (params) => axios.get('admin/user/getExpertsList', {'params':{...params}});
  //获取专家的官方点评列表
  export const getExpertOfficialCommentList = (params) => axios.get('admin/user/getExpertOfficialCommentList', {'params':{...params}});
  //设置专家的官方点评
  export const setExpertOfficialComment = (params) => axios.post('admin/user/setExpertOfficialComment', params);
  //获取专家详情
  export const getExpertDetail = (params) => axios.get('admin/user/getExpertDetail', {'params':{...params}});
  //获取专家的官方点评详情
  export const getExpertOfficialCommentDetail = (params) => axios.get('admin/user/getExpertOfficialCommentDetail', {'params':{...params}});
  //删除专家的官方点评
  export const delExpertOfficialComment = (params) => axios.post('admin/user/delExpertOfficialComment', params);
  //设置专家
  export const setExpert = (params) => axios.post('admin/user/setExpert', params);
  //删除专家
  export const delExpert = (params) => axios.post('admin/user/delExpert', params);
  //获取专家预约列表
  export const getExpertAppointList = (params) => axios.get('admin/sys/getExpertAppointList', {'params':{...params}});
  //处理专家预约申请
  export const confirmAppoint = (params) => axios.post('admin/sys/confirmAppoint', params);





//需求列表
export const getDemandList = (params) => axios.get('admin/sys/getDemandList', {'params':{...params}});
//发布需求
export const sendDemandByAdmin = (params) => axios.post('admin/sys/sendDemandByAdmin', params);
//上下架需求
export const setDemandShopStatus = (params) => axios.post('admin/sys/setDemandShopStatus', params);
//审核需求
export const reviewDemand = (params) => axios.post('admin/sys/reviewDemand', params);
//删除需求
export const delDemandByAdmin = (params) => axios.post('admin/sys/delDemandByAdmin', params);
//设置诉求状态
export const setDemandStatus = (params) => axios.post('admin/sys/setDemandStatus', params);
//查看需求详情
export const getDemandDetail = (params) => axios.get('admin/sys/getDemandDetail', {'params':{...params}});
//设置需求分类
export const setDemandClassify = (params) => axios.post('admin/sys/setDemandClassify', params);
//删除需求分类
export const delDemandClassify = (params) => axios.post('admin/sys/delDemandClassify', params);
//获取需求类型列表
export const getDemandClassify = (params) => axios.get('admin/sys/getDemandClassify', {'params':{...params}});
//获取对接这个需求的用户列表
export const getDemandButtList = (params) => axios.get('admin/sys/getDemandButtList', {'params':{...params}});
//接受、淘汰对接者
export const operateDemandButt = (params) => axios.post('admin/sys/operateDemandButt', params);
//发送订阅消息
export const sendDemandSubscribeMessage = (params) => axios.post('admin/sys/sendDemandSubscribeMessage', params);
//发送模板消息
export const sendDemandByModelMsg = (params) => axios.post('admin/sys/sendDemandByModelMsg', params);
//获取对接列表
export const getDemandDockList = (params) => axios.get('admin/sys/getDockDemandList',{'params':{...params}});




//单位管理
export const getUnitList = (params) => axios.get('admin/unit/getUnitList', {'params':{...params}});

//会员单位
  //获取官方单位单位信息
  export const getOfficialUnitInfo = (params) => axios.get('admin/unit/getOfficialUnitInfo', {'params':{...params}});
  //设置官方单位信息
  export const setOfficialUnitInfo = (params) => axios.post('admin/unit/setOfficialUnitInfo', params);

  //获取单位详情
  export const getUnitDetail = (params) => axios.get('admin/unit/getUnitDetail', {'params':{...params}});
  //编辑单位信息
  export const editUnitInfo = (params) => axios.post('admin/unit/editUnitInfo', params);
  //删除会员单位
  export const delMemberUnit = (params) => axios.post('admin/unit/delMemberUnit', params);
  //获取会员单位的官方点评列表
  export const getMemberUnitOfficialCommentList = (params) => axios.get('admin/unit/getMemberUnitOfficialCommentList', {'params':{...params}});
  //设置会员单位的官方点评
  export const setMemberUnitOfficialComment = (params) => axios.post('admin/unit/setMemberUnitOfficialComment', params);
  //获取会员单位的官方点评详情
  export const getMemberUnitOfficialCommentDetail = (params) => axios.get('admin/unit/getMemberUnitOfficialCommentDetail', {'params':{...params}});
  //删除会员单位的官方点评
  export const delMemberUnitOfficialComment = (params) => axios.post('admin/unit/delMemberUnitOfficialComment', params);
  //获取单位管理员列表
  export const getUnitAdminList = (params) => axios.get('admin/unit/getUnitAdminList', {'params':{...params}});
  //添加单位管理员
  export const addUnitAdmin = (params) => axios.post('admin/unit/addUnitAdmin', params);
  //员工列表
  export const getUnitEmployeeList = (params) => axios.get('admin/unit/getUnitEmployeeList', {'params':{...params}});
  //编辑员工信息
  export const editUnitEmployeeInfo = (params) => axios.post('admin/unit/editUnitEmployeeInfo', params);
  //获取会员单位员工审核列表
  export const getUnitAuthLists  = (params) => axios.get('admin/unit/getUnitAuthList', {'params':{...params}});


  //获取单位等级列表
  export const getUnitGradeList = (params) => axios.get('admin/unit/getUnitGradeList', {'params':{...params}});
  //设置单位等级
  export const setUnitGrade = (params) => axios.post('admin/unit/setUnitGrade', params);
  //获取单位等级详情
  export const getUnitGradeDetail = (params) => axios.get('admin/unit/getUnitGradeDetail', {'params':{...params}});
  //删除等级
  export const delUnitGrade = (params) => axios.post('admin/unit/delUnitGrade', params);
  //获取单位分类
  export const getUnitClassifyList = (params) => axios.get('admin/unit/getUnitClassifyList', {'params':{...params}});
  //设置单位分类
  export const setUnitClassify = (params) => axios.post('admin/unit/setUnitClassify', params);
  //获取单位分类详情
  export const getUnitClassifyDetail = (params) => axios.get('admin/unit/getUnitClassifyDetail', {'params':{...params}});
  //删除单位分类
  export const delUnitClassify = (params) => axios.post('admin/unit/delUnitClassify', params);

  //获取发票抬头列表
  export const getInvoiceLookUpList = (params) => axios.get('admin/unit/getInvoiceLookUpList', {'params':{...params}});
  //获取发票抬头详情
  export const getInvoiceLookUpDetail = (params) => axios.get('admin/unit/getInvoiceLookUpDetail', {'params':{...params}});
  //设置发票抬头
  export const setInvoiceLookUp = (params) => axios.post('admin/unit/setInvoiceLookUp', params);
  //删除发票抬头
  export const delInvoiceLookUp = (params) => axios.post('admin/unit/delInvoiceLookUp', params);
  //发票记录
  export const getInvoiceRecordList = (params) => axios.get('admin/unit/getInvoiceRecordList', {'params':{...params}});








//审核列表
export const getUnitSettledApplyList = (params) => axios.get('admin/unit/getUnitSettledApplyList', {'params':{...params}});
//改变入驻申请的状态
export const changeUnitSettledApplyStatus = (params) => axios.post('admin/unit/changeUnitSettledApplyStatus', params);
//删除入驻申请
export const delUnitSettledApply = (params) => axios.post('admin/unit/delUnitSettledApply', params);









//活动管理

//获取活动方列表
export const getActivePartyList = (params) => axios.get('admin/activity/getActivePartyList', {'params':{...params}});
//活动方详情
export const getActivePartyDetail = (params) => axios.get('admin/activity/getActivePartyDetail', {'params':{...params}});
//设置活动方
export const setActiveParty = (params) => axios.post('admin/activity/setActiveParty', params);
//删除活动方
export const delActiveParty = (params) => axios.post('admin/activity/delActiveParty', params);
//获取报名表字段
export const getSignUpTableField = (params) => axios.get('admin/activity/getSignUpTableField', {'params':{...params}});
//设置活动
export const setActivity = (params) => axios.post('admin/activity/setActivity', params);
//获取活动详情
export const getActivityDetail = (params) => axios.get('admin/activity/getActivityDetail', {'params':{...params}});
//获取活动列表
export const getActivityList = (params) => axios.get('admin/activity/getActivityList', {'params':{...params}});
//删除活动
export const delActivity = (params) => axios.post('admin/activity/delActivity', params);
//获取活动报名人数接口
export const getActivitySignInList = (params) => axios.get('admin/activity/getActivitySignInList', {'params':{...params}});
//获取全部报名成功用户
export const getSignUpSuccessList = (params) => axios.get('admin/activity/getSignUpSuccessList', {'params':{...params}});
//确认签到
export const activitySign = (params) => axios.post('admin/activity/activitySign', params);
//申请开票
export const submitOpenInvoiceApply = (params) => axios.post('admin/activity/submitOpenInvoiceApply', params);
//审核活动报名
export const activitySignUpReview = (params) => axios.post('admin/activity/activitySignUpReview', params);
//获取活动条款
export const getTermsService  = (params) => axios.get('admin/sys/getTermsService ', {'params':{...params}});
//设置活动条款
export const setTermsService = (params) => axios.post('admin/sys/setTermsService', params);
//设置活动条款状态
export const setTermsServiceStatus = (params) => axios.post('admin/sys/setTermsServiceStatus ', params);









//资讯模块
//设置资讯分类
export const setNewsClassify = (params) => axios.post('admin/sys/setNewsClassify', params);
//删除分类
export const delNewsClassify = (params) => axios.post('admin/sys/delNewsClassify', params);
//发布资讯
export const sendNewsByAdmin = (params) => axios.post('admin/sys/sendNewsByAdmin', params);
//删除资讯
export const delNewsByAdmin = (params) => axios.post('admin/sys/delNewsByAdmin', params);
//修改资讯展示状态
export const changeNewsStatus = (params) => axios.post('admin/sys/changeNewsStatus', params);



//获取资讯类型列表
export const getNewsClassifyList = (params) => axios.get('admin/sys/getNewsClassifyList', {'params':{...params}});
//获取资讯评论列表
export const getNewsComment = (params) => axios.get('admin/sys/getNewsComment', {'params':{...params}});
//获取所有的评论列表
export const getAllCommentList = (params) => axios.get('admin/sys/getAllCommentList', {'params':{...params}});
//审核评论
export const reviewComment = (params) => axios.post('admin/sys/reviewComment', params);
//后台发布官方评论
export const sendOfficialComment = (params) => axios.post('admin/sys/sendOfficialComment', params);
//删除评论
export const delComment = (params) => axios.post('admin/sys/delComment', params);

//获取公众号的素材
export const syncNewsMaterialFromWeChat = (params) => axios.get('admin/sys/syncNewsMaterialFromWeChat', {'params':{...params}});




//获取资讯详情
export const getNewsDetail = (params) => axios.get('admin/sys/getNewsDetail', {'params':{...params}});
//获取资讯列表
export const getNewsList = (params) => axios.get('admin/sys/getNewsList', {'params':{...params}});


//获取行业列表
export const getIndustryList = (params) => axios.get('admin/sys/getIndustryList', {'params':{...params}});
//获取诉求类型
export const getDemandAreaList = (params) => axios.get('demand/getDemandAreaList', {'params':{...params}});
//设置诉求类型
export const setDemandArea = (params) => axios.post('admin/sys/setDemandArea', params);
//设置诉求时间
export const setDemandCreateTime = (params) => axios.post('admin/sys/setDemandCreateTime', params);


// 认证模块
//个人认证列表
export const getPersonalAuthList = (params) => axios.get('admin/auth/getPersonalAuthList', {'params':{...params}});
//改变个人认证审核状态
export const changePersonalAuthStatus = (params) => axios.post('admin/auth/changePersonalAuthStatus', params);
//专家认证列表
export const getExpertAuthList = (params) => axios.get('admin/auth/getExpertAuthList', {'params':{...params}});
//改变专家认证状态
export const changeExpertAuthStatus = (params) => axios.post('admin/auth/changeExpertAuthStatus', params);
//单位认证列表
export const getUnitAuthList = (params) => axios.get('admin/auth/getUnitAuthList', {'params':{...params}});
//改变单位认证审核状态
export const changeUnitAuthStatus = (params) => axios.post('admin/auth/changeUnitAuthStatus', params);


//消息
  //系统消息
  //设置系统通知
  export const setSysNews = (params) => axios.post('admin/sys/addSysMessage', params);
  //获取系统通知列表
  export const getSysNewsList = (params) => axios.get('admin/sys/getMessageList', {'params':{...params}});
  //获取系统通知详情
  export const getSysNewsDetail = (params) => axios.get('admin/sys/getMessageDetail', {'params':{...params}});
  //删除系统通知
  export const delSysNews = (params) => axios.post('admin/sys/delSysMessage', params);

//运营管理
  //获取付费套餐列表
  export const getVipPackageList = (params) => axios.get('admin/operation/getVipPackageList', {'params':{...params}});
  //改变套餐状态
  export const changeVipPackageStatus = (params) => axios.post('admin/operation/changeVipPackageStatus', params);
  //获取绑定该套餐的单位列表
  export const getBindPackageMemberUnitList = (params) => axios.get('admin/operation/getBindPackageMemberUnitList', {'params':{...params}});
  //解除单位绑定的套餐
  export const UnitUntieVipPackage = (params) => axios.post('admin/operation/UnitUntieVipPackage', params);

  //套餐绑定到单位
  export const vipPackageBindUnit = (params) => axios.post('admin/operation/vipPackageBindUnit', params);

  //获取用户权益表格
  export const getUserRightsList = (params) => axios.get('admin/operation/getUserRightsList', {'params':{...params}});
  //续费购买套餐
  export const buildOrder = (params) => axios.post('order/buildOrder', params);
  //微信支付
  export const weChatPayment = (params) => axios.post('payment/weChatPayment', params);
  //获取支付状态
  export const getPayStatus = (params) => axios.get('payment/getPayStatus', {'params':{...params}});


//设置付费套餐
  export const setVipPackage = (params) => axios.post('admin/operation/setVipPackage', params);
  //删除付费套餐
  export const delVipPackage = (params) => axios.post('admin/operation/delVipPackage', params);

  //获取套餐详情
  export const getVipPackageDetail = (params) => axios.get('admin/operation/getVipPackageDetail', {'params':{...params}});

  //获取用户权益
  export const getVipRuleList = (params) => axios.get('admin/operation/getVipRuleList', {'params':{...params}});








//系统管理
  //轮播图
  export const getBannerList = (params) => axios.get('admin/sys/getBannerList', {'params':{...params}});
  //编辑轮播图
  export const bannerSet = (params) => axios.get('admin/sys/bannerSet', {'params':{...params}});
  //新增轮播图
  export const setBanner = (params) => axios.post('admin/sys/setBanner', params);
  //删除banner
  export const delBanner = (params) => axios.post('admin/sys/delBanner', params);
  //获取圈子详情
  export const getBannerDetail = (params) => axios.get('admin/sys/getBannerDetail', {'params':{...params}});
  //获取栏目列表
  export const getSectionClassifyList = (params) => axios.get('admin/sys/getSectionClassifyList', {'params':{...params}});
  //设置栏目
  export const setSectionClassify = (params) => axios.post('admin/sys/setSectionClassify', params);
  //获取栏目详情
  export const getSectionClassifyDetail = (params) => axios.get('admin/sys/getSectionClassifyDetail', {'params':{...params}});
  //删除栏目
  export const delSectionClassify = (params) => axios.post('admin/sys/delSectionClassify', params);
  //获取栏目链接
  export const getSectionUrl = (params) => axios.get('admin/auth/getSectionUrl', {'params':{...params}});


//获取管理员列表
  export const getAdminList = (params) => axios.get('admin/auth/adminList', {'params':{...params}});
  //编辑管理员
  export const adminSet = (params) => axios.get('admin/auth/adminSet', {'params':{...params}});
  //添加管理员
  export const setAdmin = (params) => axios.post('admin/auth/setAdmin', params);
  //删除管理员
  export const delAdmin = (params) => axios.post('admin/auth/delAdmin', params);
  //获取会员到期提醒时间
  export const getVipMaturityRemindTime = (params) => axios.get('admin/auth/getVipMaturityRemindTime', {'params':{...params}});
  //设置会员到期提醒时间
  export const setVipMaturityRemindTime = (params) => axios.post('admin/auth/setVipMaturityRemindTime', params);


  //获取权限列表
  export const getPermissionsList = (params) => axios.get('admin/auth/permissionsList', {'params':{...params}});
  //获取我的权限列表
  export const getMyPermission = (params) => axios.get('admin/auth/getMyPermission', {'params':{...params}});
  //编辑权限
  export const permissionsSet = (params) => axios.get('admin/auth/permissionsSet', {'params':{...params}});
  //新增权限
  export const addPermissions = (params) => axios.post('admin/auth/setPermissions', params);
  //删除权限
  export const delPermissions = (params) => axios.post('admin/auth/delPermissions', params);

  //获取角色列表
  export const getRoleList = (params) => axios.get('admin/auth/roleList', {'params':{...params}});
  //编辑角色
  export const roleSet = (params) => axios.get('admin/auth/roleSet', {'params':{...params}});
  //添加角色
  export const setRole = (params) => axios.post('admin/auth/setRole', params);
  //删除角色
  export const delRole = (params) => axios.post('admin/auth/delRole', params);



  //获取关于我们
  export const getAboutUsDetail = (params) => axios.get('admin/sys/getAboutUsDetail', {'params':{...params}});
  //设置关于我们
  export const setAboutUs = (params) => axios.post('admin/sys/setAboutUs', params);


//获取消息通知列表
export const getAdminMessageList = (params) => axios.get('admin/sys/getAdminMessageList', {'params':{...params}});
//设置关于我们
export const setAlreadyRead = (params) => axios.post('admin/sys/setAlreadyRead', params);
//设置诉求的反馈
export const demandReback = (params) => axios.post('admin/sys/demandReback', params);





























